﻿
using System;
using System.Collections.Generic;

using UnityEngine;

namespace Yoozoo.Gameplay.City
{
    public enum EventState
    {
        None = 0,
        IN = 1,
        Out = 2,
        All = 3,
    }

    public enum RoomState
    {
        None = 0,
        Work = 1,
        Idle = 2,
    }

    public enum PointState
    {
        None = 0,
        IN = 1,
        Out = 2,
        All = 3,
    }

    public enum GroupType
    {
        Group_1          = 0,
        Group_2          = 1,
        Group_3          = 2,
        Group_4          = 3,
        Group_5          = 4,
        Group_6          = 5,
        Group_7          = 6,
        Group_8          = 7,
        Group_9          = 8,
        Group_10         = 9,
    }
    
    [Serializable]
    public class OutNPCPoint
    {
        public Transform eventPoint;// 小人事件点的节点
        public bool isWork;
    }
    [Serializable]
    public class MovePoint
    {
        public string eventName;    // 小人要执行的事件的名字
        public int needTime;        // 小人需要执行事件多长时间

        public Transform eventPoint;// 

        public float rotate; //Y轴旋转角度
        public bool needRotate = true;

        public bool isWork;
    }
    [Serializable]
    public class RoomEvent
    {
        [Header("对应事件表的ID")]
        public int eventId;
        [Header("事件挂点列表")]
        public List<EventPointData> pointDataList;
        [Header("该事件的是需要房间内小人还是房间外小人来执行")]
        public EventState state;
        [Header("关联房间的状态")]
        public RoomState roomState;
    }
    
    [Serializable]
    public class EventPointData
    {
        [Header("挂点")]
        public Transform point;
    }
    
    [Serializable]
    public class GoodsPointData
    {
        [Header("备注")]
        public string Text;
        [Header("对应事件表的ID")]
        public int eventId;
        [Header("事件分组")]
        public GroupType Group;
        [Header("挂点")]
        public Transform point;
        [Header("触发交互物事件")]
        public string GoodsTriggerName;
        // [Header("固定触发交互物")]
        // public Transform FixedTriggerObj;
        [Header("移动型交互物的位置")] 
        public Transform MovedTriggerObj;
    }
    [Serializable]
    public class RoomGoods
    {
        [Header("备注")]
        public string Text;

        [Header("解锁房间ID")] 
        public int UnlockBuildId = 0;
        [Header("解锁等级")] 
        public int UnlockLevel = 0;
        [Header("对应设施ID")] 
        public int FacilityId = 0;
        [Header("交互物")]
        public GameObject Goods;
        [Header("交互物内点位")]
        public List<GoodsPointData> PointList;
    }

    public class RoomEventData:MonoBehaviour
    {
        [Header("房间ID")]
        public int RoomId;
        
        [Header("房间交互物列表")]
        public List<RoomGoods> RoomGoodsList;
    }
    
}

